home *** CD-ROM | disk | FTP | other *** search
- RGBDecode
- =========
-
- Version 1.02 (02 Dec 1997)
-
- Introduction
- ------------
- If you've used the X window system then you'll no doubt have come across the
- concept of colour naming. Indeed, this seems to be an emerging trend on the
- web to use constructs such as <font color="<name>|#<number>"> to change the
- style of pages (well, maybe not so much a trend as a standard then... call it
- what you will, but until an RFC comes out I'll just call it a trend, ok ?)
-
- However, we've no concept of this on the Arc. So, the RGBDecode module is
- intended to fill this gap by allowing you to specify colour names and to have
- these converted to numbers and back again.
-
-
- Usage
- -----
- The module works by pair of SWIs which look up the information requested in
- the file InetDBase:RGB - whilst this is not currently standard, I hope to
- convince enough people to make it so :-)
-
- The calls are (SWI chunk un-registered, but will be soon, honest) :
-
- RGB_DecodeName (&90680 for the time being)
- --------------
- => r0-> colour name
- <= r1 = &BBGGRR00 of colour, or -1 if colour could not be found in database
-
- Changes a colour name into a colour number. #rrggbb names will always work,
- but 'real' names require the database.
-
- RGB_EncodeName (&90681 for the time being)
- --------------
- => r0-> &BBGGRR00 of colour
- r1 = flags
- b0 = 0 : find exact match
- 1 : find best match without resorting to #rrggbb
- r2-> 64 byte block (128 bytes if b0 set)
- <= r1-> name, or -1 if could not be matched
- r0 = distance of returned colour from that requested, if b0 set
-
- Changes a colour number into a colour name.
-
- The 'best match' rule uses the same weightings as the ColourTrans module
- (R=2, G=4, B=1).
-
-
- Disclaimer
- ----------
- The author accepts no responsibility for any problems which this application
- may cause or loss of data resulting in its use. This applications is
- Public Domain Freeware. It may be used in any application, whether Freeware,
- Shareware, Commercial, or otherwise without any fee or licencing
- requirements. The code should not be modified however without my (Justin
- Fletcher's) consent.
-
- I would like this module, or at least the interface to this module, to become
- a 'standard' means of accessing a colour database. Whether this will come
- about is anybody's guess...
-
- I'd also like to say that the names in the rgb file were invented by someone
- else. I do not understand all of them. Things like PapayaWhip and cornsilk
- leave me completely confused. However, mine is not to reason why...
-
-
- Source code
- -----------
- Source code is available on request (however you like, but email is
- preferred).
-
-
- Contact
- -------
- Any comments, queries, donations or bug reports can be sent to Justin
- Fletcher at :
-
- E-Mail : Gerph@essex.ac.uk
- URL : http://users.essex.ac.uk/users/gerph
- IRC : On #Acorn as Gerph
- Finger : finger gerph@innocent.com
- Tel : (01842) 813979
-
- Snail Mail :
- Justin Fletcher
- “Galadriel”
- 17b Cromwell Road,
- Weeting,
- Brandon,
- Suffolk.
- IP27 0QT
-
-
- History
- -------
- Version 1.00 : 15 Dec 1996
- Module providing 2 SWIs to decode and encode the colour names
- Version 1.01 : 15 Dec 1996
- Minor bug fix to allow EncodeName to work under all
- circumstances (will return #rrggbb type colour if no database).
- Version 1.02 : 02 Dec 1997
- Made RGB_DecodeName not require a buffer for working in. Added
- *RGBColour command to display colours textually.
-